package lueder.utilities;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;

public class GeneralUtilities {

	static String serverName = "localhost";
	static int serverPort = 80;
	static String imagePath = "/klkshop/images";

	public static String getProductImagesPath() {
		return "http://" + serverName + ":" + serverPort + imagePath
				+ "/product_images/";
	}

	public static String getServerName() {
		return serverName;
	}

	public static int getServerPort() {
		return serverPort;
	}

	public static String getImagePath() {
		return imagePath;
	}

	public static boolean URLexists(String URL) {
		URL url;
		try {
			url = new URL(URL);
		} catch (MalformedURLException e) {
			return false;
		}
		try {
			url.openStream().close();
			return true;
		} catch (IOException e) {
			return false;
		}

	}
	
	public static ArrayList<String> seperateSearchString(String str)
	{
		ArrayList<String> list = new ArrayList<String>();
		
		return list;
	}
}